/**
 * 
 */
package com.google.code.jkippt.query;

import java.util.Calendar;
import java.util.Map;

import com.google.code.jkippt.http.ParametersBuilder;

/**
 * @author Federico De Faveri defaveri@gmail.com
 */
public class ClipQuery {
	
	protected boolean includeList;
	protected boolean includeVia;
	protected boolean includeMedia;
	protected String url;
	protected Calendar since;
	
	/**
	 * @return the includeList
	 */
	public boolean isIncludeList() {
		return includeList;
	}

	/**
	 * @param includeList the includeList to set
	 */
	public void setIncludeList(boolean includeList) {
		this.includeList = includeList;
	}

	/**
	 * @return the includeVia
	 */
	public boolean isIncludeVia() {
		return includeVia;
	}

	/**
	 * @param includeVia the includeVia to set
	 */
	public void setIncludeVia(boolean includeVia) {
		this.includeVia = includeVia;
	}

	/**
	 * @return the includeMedia
	 */
	public boolean isIncludeMedia() {
		return includeMedia;
	}

	/**
	 * @param includeMedia the includeMedia to set
	 */
	public void setIncludeMedia(boolean includeMedia) {
		this.includeMedia = includeMedia;
	}

	/**
	 * @return the url
	 */
	public String getUrl() {
		return url;
	}

	/**
	 * @param url the url to set
	 */
	public void setUrl(String url) {
		this.url = url;
	}

	/**
	 * @return the since
	 */
	public Calendar getSince() {
		return since;
	}
	
	/**
	 * @param since the since to set
	 */
	public void setSince(Calendar since) {
		this.since = since;
	}
	
	public Map<String, String> toParameters()
	{
		ParametersBuilder builder = new ParametersBuilder();
		builder.add("include_data", new boolean[]{includeList, includeVia, includeMedia}, new String[]{"list", "via", "media"});
		builder.add("url", url);		
		builder.add("since", since);
		return builder.build();
	}

	/** 
	 * {@inheritDoc} 
	 */
	@Override
	public String toString() {
		StringBuilder builder = new StringBuilder();
		builder.append("ClipQuery [includeList=");
		builder.append(includeList);
		builder.append(", includeVia=");
		builder.append(includeVia);
		builder.append(", includeMedia=");
		builder.append(includeMedia);
		builder.append(", url=");
		builder.append(url);
		builder.append(", since=");
		builder.append(since);
		builder.append("]");
		return builder.toString();
	}
}
